BizTalk 2013 EDI for Health Care by Mark Beckner

BizTalk 2013 EDI for Health Care by Mark Beckner

Author:Mark Beckner
Language: eng
Format: epub
ISBN: 9781430266075
Publisher: Apress


With the FTP adapter settings configured properly, you need only to focus on the requirements of the send pipeline.

Pipelines and Pipeline Components

One of the most complex tasks in BizTalk is creating custom pipelines, as it is pure C# development. If you are using PGP for encryption and decryption, some pointers on how to develop this custom pipeline component are outlined in this section. If you need to use an alternative encryption format, then you'll need to code something specific to the tools that are used for that format. In either case, you'll need someone who is familiar with C# development to be available to work on this.

There are two items that must be set up for both the send pipeline that will encrypt data and the receive pipeline that will decrypt data. These items are the custom pipeline and the custom pipeline component. The custom pipeline component should be developed first. Let's assume that you are going to be dealing with PGP encrypted data. There are several tools that you could use - one of the easiest to interact with is GNU Privacy Guard (www.gnupg.org). This utility allows for the generation and management of PGP keys, and provides a command line interface that can be communicated with via C# .NET code.

Calling the command line tool requires that you build out a .NET class to wrap the call so that the pipeline can pass parameters to the command line and execute it (using System.Diagnostics.ProcessStartInfo is one option to do this). Assuming you have built a wrapper class for the GNU Privacy Guard command line tool (generally located in the GNU/GnuPG/pub directory), then a sample of calling this command line tool from within a custom pipeline component to encode data is shown in Listing 5-1, while a sample of decoding data is shown in Listing 5-2.

Listing 5-1. Calling a Class to Encode Data with Parameters

GnuPGWrapper GPG = new GnuPGWrapper(_gnupgbindir);

GnuPGCommand GPGCommand = GPG.Command;

GPGCommand.Command = Commands.Encrypt;

GPGCommand.Recipient = _recipient;

// this is the recipient on the PGP key

GPGCommand.Passphrase = _passphrase ;

// this is the passphrase on the PGP key

GPGCommand.Armor = true;

GPGCommand.InputFile = inFile;

GPGCommand.OutputFile = outFile;

Listing 5-2. Calling a Class to Decode Data with Parameters

GnuPGWrapper GPG = new GnuPGWrapper(_gnupgbindir);

GnuPGCommand GPGCommand = GPG.Command;

GPGCommand.Command = Commands.Decrypt;

GPGCommand.InputFile = inFile;

GPGCommand.OutputFile = outFile;

GPGCommand.Passphrase = _passphrase;

// this is the passphrase of the PGP key

Creating the custom pipeline component will take some effort, and will depend on the encryption and decryption requirements of your solution. You will want to make a number of the fields configurable, so that you can use the send and receive pipelines on multiple trading partners. Figure 5-3 shows what these configurable properties could look like when they are set within the custom pipeline in Visual Studio.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.